home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 52 / Amiga Format AFCD52 (Issue 136, May 2000).iso / -screenplay- / hd_installers / whdidemos / scoopex_melodies.lha / Melodies / Install_Melodies next >
Text File  |  1999-10-30  |  4KB  |  184 lines

  1. ;****************************
  2.  
  3. (set #readme-file "melodieshd.readme") ;name of readme file
  4. (set #last-disk 3)          ;amount of disks
  5. (set #disk-size 901120)     ;size of each disk
  6.  
  7. ;****************************
  8. ;----------------------------
  9. ; Checks if given program is reachable via the path
  10. ; if not abort install
  11. ; IN:  #program - to check
  12. ; OUT: -
  13.  
  14. (procedure P_chkrun
  15.   (if
  16.     (= 0 (run ("cd SYS:\nWhich %s" #program)))
  17.     ("")
  18.     (abort ("You must install \"%s\" first !\nIt must be accessible via the path.\nYou can find it in the WHDLoad package." #program))
  19.   )
  20. )
  21.  
  22. ;----------------------------
  23. ; Create disk-Image using DIC
  24. ; IN:  #dest        - DestinationPath
  25. ;      #CI_diskname - DiskName
  26. ;      #CI_diskno   - DiskNumber
  27. ;      #CI_drive    - DriveToReadFrom
  28. ; OUT: -
  29.  
  30. (procedure P_image
  31.   (message ("\nInsert \"%s\" into drive %s !\n\n(make sure it's the right disk because it will not be checked)" #CI_diskname #CI_drive))
  32.   (if
  33.     (= 0
  34.       (run ("cd \"%s\"\nDIC %s FD=%ld LD=%ld SIZE=%ld >CON:///1000//CLOSE" #dest #CI_drive #CI_diskno #CI_diskno #disk-size))
  35.     )
  36.     (run ("FileNote %s Quiet" #CI_diskname))
  37.     (abort "\"DIC\" has failed to create a diskimage")
  38.   )
  39. )
  40.  
  41. ;****************************
  42.  
  43. (if
  44.   (exists #readme-file)
  45.   (if
  46.     (= 0 (run ("SYS:Utilities/Multiview %s" #readme-file)))
  47.     ("")
  48.     (run ("SYS:Utilities/More %s" #readme-file))
  49.   )
  50. )
  51.  
  52. (set #program "WHDLoad")
  53. (P_chkrun)
  54.  
  55. (set #program "DIC")
  56. (P_chkrun)
  57.  
  58. ; in expert mode ask for source drive
  59. (if
  60.   (= @user-level 2)
  61.   (
  62.     (set #CI_drive
  63.       (askchoice
  64.     (prompt "Select source drive for diskimages")
  65.     (default 0)
  66.     (choices "DF0:" "DF1:" "RAD:" "Enter Device")
  67.     (help @askchoice-help)
  68.       )
  69.     )
  70.     (select #CI_drive
  71.       (set #CI_drive "DF0:")
  72.       (set #CI_drive "DF1:")
  73.       (set #CI_drive "RAD:")
  74.       (set #CI_drive
  75.         (askstring
  76.           (prompt "Select source drive for diskimages")
  77.           (default "DF0:")
  78.           (help @askstring-help)
  79.         )
  80.       )
  81.     )
  82.   )
  83.   (set #CI_drive "DF0:")
  84. )
  85.  
  86. (set @default-dest
  87.   (askdir
  88.     (prompt ("Where should \"%s\" installed ?\nA drawer \"%s\" will automatically created." @app-name @app-name))
  89.     (help @askdir-help)
  90.     (default @default-dest)
  91.     (disk)
  92.   )
  93. )
  94. (set #dest (tackon @default-dest @app-name))
  95. (if
  96.   (exists #dest)
  97.   (
  98.     (set #choice
  99.       (askbool
  100.         (prompt ("\nDirectory \"%s\" already exists.\n Should it be deleted ?" #dest))
  101.         (default 1)
  102.         (choices "Delete" "Skip")
  103.         (help @askbool-help)
  104.       )
  105.     )
  106.     (if
  107.       (= #choice 1)
  108.       (run ("Delete \"%s\" \"%s.info\" All" #dest #dest))
  109.     )
  110.   )
  111. )
  112. (makedir #dest
  113.   (help @makedir-help)
  114.   (infos)
  115. )
  116.  
  117. ;----------------------------
  118.  
  119. (copyfiles
  120.   (help @copyfiles-help)
  121.   (source ("%s.Slave" @app-name))
  122.   (dest #dest)
  123. )
  124. (if
  125.   (exists ("%s.newicon" @app-name))
  126.   (set #icon
  127.     (askchoice
  128.       (prompt "\nWhich icon do you like to install ?\n")
  129.       (default 0)
  130.       (choices "Normal" "NewIcon")
  131.       (help @askchoice-help)
  132.     )
  133.   )
  134.   (set #icon 0)
  135. )
  136. (select #icon
  137.   (set #icon ("%s.inf" @app-name))
  138.   (set #icon ("%s.newicon" @app-name))
  139. )
  140. (copyfiles
  141.   (help @copyfiles-help)
  142.   (source #icon)
  143.   (newname ("%s.info" @app-name))
  144.   (dest #dest)
  145. )
  146.  
  147. (copyfiles
  148.     (help @copyfiles-help)
  149.     (source "OSEmu.400")
  150.     (dest #dest)
  151.     (infos)
  152. )
  153.  
  154. (if
  155.   (exists #readme-file)
  156.   (copyfiles
  157.     (help @copyfiles-help)
  158.     (source #readme-file)
  159.     (dest #dest)
  160.   )
  161. )
  162. (if
  163.   (exists ("%s.info" #readme-file))
  164.   (copyfiles
  165.     (help @copyfiles-help)
  166.     (source ("%s.info" #readme-file))
  167.     (dest #dest)
  168.   )
  169. )
  170.  
  171. (set #CI_diskno 1)
  172. (while
  173.   (<= #CI_diskno #last-disk)
  174.   (
  175.     (set #CI_diskname ("%s Disk %ld" @app-name #CI_diskno))
  176.     (P_image)
  177.     (set #CI_diskno (+ #CI_diskno 1))
  178.   )
  179. )
  180.  
  181. ;----------------------------
  182.  
  183. (exit)
  184.